calling an object method from another method not working